---
import ArticleItem from "./ArticleItem.astro"

---
<!-- 固定请求数据  然后动态分页-->

<th:block th:each="article,iterStat : ${data.rows}">
    <ArticleItem classAppend="${'mock-page mock-page-'+(1+iterStat.index/20)}"/>
</th:block>

<script>
    const createTimeDom = document.querySelectorAll(".show-create-time");
    const showKdom = document.querySelectorAll(".show-k");
    createTimeDom.forEach((item) => {
      if (item.dataset.time) {
        item.innerHTML = graceUtils.formatRelativeTime(new Date(item.dataset.time).getTime()); // 假设这是文章的发布时间戳
      } else {
      }
    });
    showKdom.forEach((item) => {
      if (item.dataset.count) {
        item.innerHTML = graceUtils.convertToK(item.dataset.count);
      } else {
      }
    });
</script>
